<?php

require_once '../ptnhuan-web1/data/users.php';


if(isset($_POST["enter"]))
{
    $nhap = false;
    for ($i = 0; $i < count($users); $i++) {
        if (strcmp($_POST["username"], $users[$i]["username"]) == 0 && strcmp($_POST["password"], $users[$i]["password"]) == 0) {
            $nhap = true;
            break;
        } else {
            $nhap = false;
        }
    }
    if ($nhap == true)
        echo $_POST["username"] . " Dang nhap thanh cong";
    else
        echo $_POST["username"] . " Dang nhap sai xin moi dang nhap lai ";


    }



?>

